<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="db.SupplierDAO"%>
<%@page import="db.Supplier"%>
<%
	WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	SupplierDAO supplierDao = (SupplierDAO)ctx.getBean("SupplierDAO");
	
	String sid_str = request.getParameter("sid");
	Integer sid_int = 0;
	
	if(sid_str != null && !"".equals(sid_str)){
		try{
			sid_int = Integer.parseInt(sid_str);
		}catch(Exception e){
			sid_int = 0;
		}
	}
	
	if(sid_int != 0){
		Supplier supplier = supplierDao.findById(sid_int);
		request.setAttribute("supplier",supplier);
		
		pageContext.forward("/vm/supinfo/mod_supinfo.vm");
	}
	
%>